#C++ Nested If Else Statement
Explore tagged Tumblr posts
Text
youtube
C++ Nested If Else Statement in Hindi | Nested If Else Statement in C++ | C++ Tutorials
A nested if-else statement is an if or else statement placed inside another if or else block. This allows for more complex conditions, where multiple levels of decisions need to be made based on different criteria. For more details, Kindly check my website URL. https://www.removeload.com/cpp-else-if-statement
0 notes
Text



Cupids choke hold જ⁀➴ᡣ𐭩 C. Sturniolo
"dad, i think i finally found the one."
⟢Fluff really, Chris just being in love with bun
@bernardsbendystraws for credit
The sun was setting over the city of angels, and Chris was entranced by his own angel.
Bunny.
He stared down at his lock screen, smiling softly to himself as the picture brought warmth to his chest. His admiration was interrupted by his phone ringing, a name popping up that he hadn't spoken to in a while. He answers the call and puts it on speaker, instantly feeling comforted by the voice on the other end.
"Hey son, where have you been?"
The question makes him feel guilty. He was always a mama's boy despite his harsh exterior, his mother being his rock and safe place, and she loved it. The mother and son duo knew to a degree it wasn't fair, but they were each other's favorites, and everyone else knew it too.
"Hey Ma," he says softly, inhaling a bit of the joint before tapping the excess ashes off. "I know it's been a minute since we last spoke...I have so much to tell you."
He begins to feel nervous like he is about to be judged. He knew it was an irrational fear, his mother would never judge him, even when he did something wrong.
"It's going to sound like a bad joke, but Ma...I fell in love, I found the real thing. I got a girlfriend and she's amazing."
A bit of shuffling is heard on the other end before she responds to him, "A girlfriend? Is the same one that- No." Chris instantly cuts her off, not even wanting to bring up the last girl. She was never his girlfriend. He would never say this to his mother, but she was nothing more than a quick fuck to him.
"No no, this...This is someone new and she's the best thing to happen to me. I probably sound like an old person, but Cupids got me in a chokehold. You know me, I've always been scared to let people in, especially girls, but she made it so easy that I threw the towel down. My white flag is waving, and I'm okay with that."
He couldn't help himself, instantly going on a long ramble about the girl he found himself to love so much.
"-I mean, she cooks me pancakes in the morning, the blueberry ones that you make me when I'm back home. God, and I'm starting to think you two use the same ingredients."
"And what are those ingredients?"
He smiles dopily to himself, looking down at his beat-up Nike slides,
"Love."
Mary-Lou finds herself smiling. She had been worried when her boys finally left the nest they call a home that they wouldn't be ok, but it seemed as if they were doing just fine, finding the right people to have in their lives and keeping their heads straight.
"Tell me more." She urges gently, not wanting to scare the boy into retreating his feelings, but also wanting to know more about the special girl who managed to capture her youngest attention and heart.
"When my stomach hurts, she always gets me Alka seltzers. When I'm sick she goes above and beyond to make sure I'm ok. If that ain't love then don't know what love is, it's like we're married."
"Well, it is through sickness and health, they say during the vows."
He chuckles to himself and continues, "We have this secret handshake, we came up with it on our fourth date when I learned she didn't know how to dapp people up. We're always doing it before she goes to practice and it just brings me so much comfort. Oh, and she even gets along with Matt and Nick! You know how close we are, and I don't think I could date someone who doesn't respect them. She even supports the YouTube shi- I mean stuff we do! I know I'm not that much involved, but she's pushed me to participate more, to be something more."
"...You sound in love..." Mary-Lou states softly, trying to hold in her excitement.
Chris chuckles to himself, nodding along despite Mary Lou not being able to see him.
"I am...I really am. If I had to pick her or the sun, Ma, I'm telling you I'd be a nocturnal son of a gun."
She laughs at his statement, soon urging him to send her a picture of the girl.
"Oh Chris, she's so pretty! And the way you look at her, it's the same way your dad looks at me. You have to bring her to Boston soon!"
So he did.
His chest was ready to burst with excitement and joy seeing the girl he loves so much getting along with his parents and older brother. She fit right in, doing crossword puzzles with his mom, playing Just Dance with Justin, and even going fishing with his dad.
It was late into the night, Chris sitting outside on the back porch, smoking with a glass of water in his hand. Bunny had fallen asleep on the couch with Trevor, both she and the dog snuggled up into a ball and sleeping peacefully. He looks up hearing the door open, smiling gently when he sees his dad.
Jimmy takes a seat in the empty chair next to Chris, settling down and letting out a deep breath. They sit in silence for a minute before Jimmy speaks.
"Tell me about her."
Chris immediately dives in, never missing an opportunity to talk about his girl.
"Dad, I think I finally found the one, the one that makes me a better person and will make you proud of me. She's like Mom, she's the best... I know there have been other girls; you've heard about them, but she's different, she's on a whole different plane. Just the way she says my name, it makes me want to give her the world, hell, even the universe."
Jimmy listens intently, watching how he talks with such passion about the girl sleeping on the couch.
"I love it when she calls me. I feel like an elementary school boy getting excited about his crush talking to him on the playground. She even has her own ringtone so I know its her calling! We used to sit on the phone for hours, doing nothing but breathing most of the time."
"She's a good girl, a real catch. I can see the love you two have for each other, I saw it when we picked you up from the airport. You two are in love and I hope it lasts."
Chris takes a sip of his water, staring out into the backyard with a smile and eyes full of love.
"I know it will, I'm not letting her get away."
He creeps back into the house softly, approaching the living room and chuckling to himself when he sees both Bun and Trev drooling in their sleep.
He goes to pick her up but stops when Justin enters the living room.
"You went soft on me," Justin voices playfully, gently pushing Chris's shoulder. Chris rubs the back of his neck, sitting down on the arm of the couch and placing a hand on the sleeping girl's shoulder.
"She's the reason, she makes it so easy to be...I don't even know. She could make the most annoying, oldest, senile man bite his tongue and talk calmly. Her eyes are so soft and comforting, it's like the sunrise on a summer day, I could stare into them for hours."
Justin watches with a knowing smile on his face. He can tell from how animated Chris gets when talking about her, that he will continue to do so forever. He's in love, and Justin knows the two will end up happily married, and he can't wait.
" She's a complete ten, the most gorgeous and graceful girl I've ever seen. She has me hooked, and I'm not complaining. She has the best laugh ever, and she laughs at all my jokes, even my dumb ones that usually piss Nick and Matt off. Like I told Dad, before we moved in with each other, we'd sit on the phone for hours not saying a word sometimes. We just wanted to be around each other and it was comforting. "
He looks down at the girl once more, toying with her curly strands gently in an attempt to not disturb her slumber.
"It may be too soon, but when I think about my future, when I think about what I want it to look like, it all surrounds her. I want to be the best version of me for her, and I want her to be happy...Call it dumb, call it luck, call it love, or whatever, but everywhere I go and do, I keep a picture of her in my wallet. I want to remember what I'm working for."
Justin walks over and plants his hand on Chris's shoulder, "I can't wait to call her my sister-in-law."
With that, Justin walks out of the living room, leaving the couple and Trevor alone. Chris is gentle when he lifts the girl off the couch, one of his hands caressing her back while the other holds her bottom. He walks up the stairs and into his room, laying her down gently on the bed.
He strips out of his hoodie, kicking off his slides, and crawling into bed, pulling her close and kissing the top of her head.
Despite her being asleep, he proceeds to whisper softly.
"I love you so much, I can't wait to spend the rest of my life with you."
She opens her eyes softly, smiling at him in a sleepy haze.
"I love you more."
#sturniolo triplets#chris sturniolo#sturniolo x reader#the sturniolo triplets#sturniolo#christopher sturniolo#chris sturniolo au#chris sturniolo imagine#chris sturniolo x reader#sturniolo fluff#sturniolo imagine#chris sturniolo x you#chris girl#peaches bunny au ft doll#doll n’ bunny mb#chris sturniolo fanfic#chris sturniolo fluff#peaches bunny🍑
455 notes
·
View notes
Note
How DOES the C preprocessor create two generations of completely asinine programmers??
oh man hahah oh maaan. ok, this won't be very approachable.
i don't recall what point i was trying to make with the whole "two generations" part but ill take this opportunity to justifiably hate on the preprocessor, holy fuck the amount of damage it has caused on software is immeasurable, if you ever thought computer programmers were smart people on principle...
the cpp:
there are like forty preprocessor directives, and they all inject a truly mind-boggling amount of vicious design problems and have done so for longer than ive been alive. there really only ever needed to be one: #include , if only to save you the trouble of manually having to copy header files in full & paste them at the top of your code. and christ almighty, we couldn't even get that right. C (c89) has way, waaaay fewer keywords than any other language. theres like 30, and half of those aren't ever used, have no meaning or impact in the 21st century (shit like "register" and "auto"). and C programmers still fail to understand all of them properly, specifically "static" (used in a global context) which marks some symbol as inelligible to be touched externally (e.g. you can't use "extern" to access it). the whole fucking point of static is to make #include'd headers rational, to have a clear seperation between external, intended-to-be-accessed API symbols, and internal, opaque shit. nobody bothers. it's all there, out in the open, if you #include something, you get all of it, and brother, this is only the beginning, you also get all of its preprocessor garbage.
this is where the hell begins:
#if #else
hey, do these look familiar? we already fucking have if/else. do you know what is hard to understand? perfectly minimally written if/else logic, in long functions. do you know what is nearly impossible to understand? poorly written if/else rats nests (which is what you find 99% of the time). do you know what is completely impossible to understand? that same poorly-written procedural if/else rat's nest code that itself is is subject to another higher-order if/else logic.
it's important to remember that the cpp is a glorified search/replace. in all it's terrifying glory it fucking looks to be turing complete, hell, im sure the C++ preprocessor is turing complete, the irony of this shouldn't be lost on you. if you have some long if/else logic you're trying to understand, that itself is is subject to cpp #if/#else, the logical step would be to run the cpp and get the output pure C and work from there, do you know how to do that? you open the gcc or llvm/clang man page, and your tty session's mem usage quadruples. great job idiot. trying figuring out how to do that in the following eight thousand pages. and even if you do, you're going to be running the #includes, and your output "pure C" file (bereft of cpp logic) is going to be like 40k lines. lol.
the worst is yet to come:
#define #ifdef #ifndef (<- WTF) #undef you can define shit. you can define "anything". you can pick a name, whatever, and you can "define it". full stop. "#define foo". or, you can give it a value: "#define foo 1". and of course, you can define it as a function: "#define foo(x) return x". wow. xzibit would be proud. you dog, we heard you wanted to kill yourself, so we put a programming language in your programming language.
the function-defines are pretty lol purely in concept. when you find them in the wild, they will always look something like this:
#define foo(x,y) \ (((x << y)) * (x))
i've seen up to seven parens in a row. why? because since cpp is, again, just a fucking find&replace, you never think about operator precedence and that leads to hilarious antipaterns like the classic
#define min(x,y) a < b ? a : b
which will just stick "a < b ? a: b" ternary statement wherever min(.. is used. just raw text replacement. it never works. you always get bitten by operator precedence.
the absolute worst is just the bare defines:
#define NO_ASN1 #define POSIX_SUPPORTED #define NO_POSIX
etc. etc. how could this be worse? first of all, what the fuck are any of these things. did they exist before? they do now. what are they defined as? probably just "1" internally, but that isn't the point, the philosophy here is the problem. back in reality, in C, you can't just do something like "x = 0;" out of nowhere, because you've never declared x. you've never given it a type. similar, you can't read its value, you'll get a similar compiler error. but cpp macros just suddenly exist, until they suddenly don't. ifdef? ifndef? (if not defined). no matter what, every permutation of these will have a "valid answer" and will run without problem. let me demonstrate how this fucks things up.
do you remember "heartbleed" ? the "big" openssl vulnerability ? probably about a decade ago now. i'm choosing this one specifically, since, for some reason, it was the first in an annoying trend for vulns to be given catchy nicknames, slick websites, logos, cable news coverage, etc. even though it was only a moderate vulnerability in the grand scheme of things...
(holy shit, libssl has had huge numbers of remote root vulns in the past, which is way fucking worse, heartbleed only gave you a random sampling of a tiny bit of internal memory, only after heavy ticking -- and nowadays, god, some of the chinese bluetooth shit would make your eyeballs explode if you saw it; a popular bt RF PHY chip can be hijacked and somehow made to rewrite some uefi ROMs and even, i think, the microcode on some intel chips)
anyways, heartbleed, yeah, so it's a great example since you could blame it two-fold on the cpp. it involved a generic bounds-checking failure, buf underflow, standard shit, but that wasn't due to carelessness (don't get me wrong, libssl is some of the worst code in existence) but because the flawed cpp logic resulted in code that:
A.) was de-facto worthless in definition B.) a combination of code supporting ancient crap. i'm older than most of you, and heartbleed happened early in my undergrad. the related legacy support code in question hadn't been relevant since clinton was in office.
to summarize, it had to do with DTLS heartbeats. DTLS involves handling TLS (or SSLv3, as it was then, in the 90s) only over UDP. that is how old we're talking. and this code was compiled into libssl in the early 2010s -- when TLS had been the standard for a while. TLS (unlike SSLv3 & predecessors) runs over TCP only. having "DTLS heartbeat support in TLS does not make sense by definition. it is like drawing a triangle on a piece of paper whose angles don't add up to 180.
how the fuck did that happen? the preprocessor.
why the fuck was code from last century ending up compiled in? who else but!! the fucking preprocessor. some shit like:
#ifndef TCP_SUPPORT <some crap related to UDP heartbeats> #endif ... #ifndef NO_UDP_ONLY <some TCP specific crap> #endif
the header responsible for defining these macros wasn't included, so the answer to BOTH of these "if not defined" blocks is true! because they were never defined!! do you see?
you don't have to trust my worldview on this. have you ever tried to compile some code that uses autoconf/automake as a build system? do you know what every single person i've spoken to refers to these as? autohell, for automatic hell. autohell lives and dies on cpp macros, and you can see firsthand how well that works. almost all my C code has the following compile process:
"$ make". done. Makefile length: 20 lines.
the worst i've ever deviated was having a configure script (probably 40 lines) that had to be rune before make. what about autohell? jesus, these days most autohell-cursed code does all their shit in a huge meta-wrapper bash script (autogen.sh), but short of that, if you decode the forty fucking page INSTALL doc, you end up with:
$ automake (fails, some shit like "AUTOMAKE_1.13 or higher is required) $ autoconf (fails, some shit like "AUTOMCONF_1.12 or lower is required) $ aclocal (fails, ???) $ libtoolize (doesn't fail, but screws up the tree in a way that not even a `make clean` fixes $ ???????? (pull hair out, google) $ autoreconf -i (the magic word) $ ./configure (takes eighty minutes and generates GBs of intermediaries) $ make (runs in 2 seconds)
in conclusion: roflcopter
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ disclaimer | private policy | unsubscribe
159 notes
·
View notes
Text
There is no need for the 'elif' keyword
I've been working on my parser for a little bit now, and I'm stealing following along this amazing article to implement a Pratt Parser. I've written a grammar for my own little language as well, inspired by Python's own grammar.
Inspired by Rust, if-statements are considered expressions. So you can use them like
foo = 1 + if 1 > 0 {1} else {0};
and it would have no problem handling that. However, like in Python, my if-statements use the 'elif' keyword to differentiate between else-if and else-statements.
However, as I'm writing my Pratt Parser, I've come to realize that there is no need for the 'elif' keyword to exist. If you write your grammar something like
expression:
| ...
| if_stmt
if_stmt:
| 'if' expression block else_stmt
| 'if' expression block
else_stmt:
| 'else' expression
it will have no problem handling else-if statements since if-statements are also expressions.
Else-statements do not have to enforce blocks since they do not have a condition body, unlike if-statements. If-statements must enforce blocks since if they didn't, the parser wouldn't know when the condition body ends and the main body started.
For a language like Python however, it uses the 'elif' keyword because it does not treat if-statements as expressions. However, they do have ternaries
A if condition else B
which look very similar to if-statements. These are treated as expressions. Because they're treated as expressions, you don't see the 'elif' keyword. Instead, nested ternaries look like
A if condition else B if condition else C
You might notice that it looks similar to
if condition {
A
} else if condition {
B
}
but just rearranged. You can also notice the 'else if'. The 'elif' keyword has been eliminated.
I didn't put much planning into this post so it probably sounds a little rambly but whatever. cheers.
28 notes
·
View notes
Text
Price: [price_with_discount] (as of [price_update_date] - Details) [ad_1] Syllabus Programming in ‘C’ Language - (312009) Learning Scheme CreditsAssessment Scheme Actual Contact Hrs./Week SLH NLH Paper DurationTheoryBased on LL & TLBased on SLTotal Marks CL TL LLPractical FA-THSA-THTotalFA-PRSA-PRSLA MaxMaxMaxMinMaxMinMaxMinMaxMin 2-2263-----25102510251075 Sr. No.Theory Learning Outcomes (TLO's) aligned to CO's.Learning content mapped with Theory Learning Outcomes (TLO's) and CO's. 1.TLO 1.1 Write the basic structure of C program. TLO 1.2 Differentiate between keywords and identifiers. TLO 1.3 Use relevant data types as per the given situation. TLO 1.4 Construct algorithm and draw flowchart for the given problem. TLO 1.5 Use different types of operators in given situations. Unit - I Basics of C Programming 1.1 Algorithms and Flow Charts : 1.1.1 Steps for writing algorithm 1.1.2 Notations of flow charts. 1.2 Structure of C program, Introduction of Assembler, Linker, Compiler, Interpreter. 1.3 Character set, Keywords, identifiers, constants, Variables 1.4 Data Types : 1.4.1 Predefined Data types : integer-unsigned, signed, long, float, double, character, single, octal, hexadecimal 1.4.2 User defined Data Types : Arrays, Structures. 1.5 Operators and expressions : 1.5.1 Formatted input and output statements 1.5.2 Types of Operators : Arithmetic, logical, relational, increment and decrement, bitwise, special operators : unary, ternary operators, 1.5.3 Precedence, Associativity of Operators. (Chapters - 1, 2) 2.TLO 2.1 Implement branching and looping. TLO 2.2 Demonstrate control statements using “if-else”. TLO 2.3 Apply different types of loops as per the given problem. Unit - II Decision Control & Looping 2.1 Introduction to decision control, branching and looping 2.2 Decision Control statements : if, if-else, if-else-if ladder, switch case, 2.3 Looping and branching Statements : 2.3.1 while Loop, 2.3.2 for Loop, nested for loop 2.3.3 do-while loop, break, Publisher : TECHNICAL PUBLICATIONS, PUNE (26 December 2023); TECHNICAL PUBLICATIONS, PUNE HARSHWARDHAN : +91 77092 33099 Paperback : 212 pages ISBN-10 : 935585756X ISBN-13 : 978-9355857569 Reading age : 18 years and up Country of Origin : India Packer : TECHNICAL PUBLICATIONS, PUNE, NARHE GODOWN, PUNE [ad_2]
0 notes
Text
so many people dont know the is_even meme and are responding seriously with something along the lines of
if a%2==0:
return True
else:
return False
but the thing is, the if statment takes a bool, so we are saying if statment true, return true, else return false. this is just a slightly more bloated version of just returning the statment, so you can just do
return a%2==0
or better yet, dont make it a function. this bit of code is small enough that writing out the func name takes longer than writing out this bit of code.
all seriousness aside, because you cant use that many if else statements in python and recursion and nesting and classes dont exist, you have to write a library in C and import it into your python project
So python is apparently unable to handle if-statement with more than 2996 elif’s, which is fair, however, it’s really limiting my implentation of an is_even function
Any ideas on how I can work around this?
5K notes
·
View notes
Text
Learn Best C Programming Language Courses
C Language is one of the most basic or beginner C Programming Languages Course, C Language has had a direct bearing on most of the programming languages that have evolved out of it, and one must at least have an understanding of what is C Language in order to be able to boss any language around. As getting complete knowledge of programming languages is very crucial and essential to enter the world of development which is considered to be the most competitive ad prestigious profession and high paying job in today’s world. So to begin the journey of learning C, you can do so with some of the best courses.
Takeoff upskill today we are going to discuss the 10 Best C Programming Courses for Beginners: these are the best courses offering you good content for learning and at the meantime issued a certificate after completion of the course. To summarize, let’s consider each of them in detail, and perhaps you will decide which method is more suitable for you.
Takeoff upskill should first read some of the C programming language information before explaining the best courses to take for C programming.
Introduction to C Programming:
An overview of C language and where it fits.
Environmental planning (IDEs- for instance VS Code, Dev-C++, etc.).
The bare structure of a C program includes the following categories:
The first process that you need to go through when writing a “Hello World” program involves writing your first program and compiling it.
Variables and Data Types:
Knowledge regarding the different variable types that are available like integers, floating-point numbers, character, etc.
Declaring and initializing variables.
Basic arithmetic operations.
Control Flow:
Conditional statements (if-else, switch-case).
Control of experiments through looping structures such as for, while, do while.
Annotation of code using breaks and continues.
Functions:
Functions and their significance for calculating regularities.
Function declaration and definition.
Passing arguments to functions.
Returning values from functions.
Arrays and Strings:
Declaring and initializing arrays.
Accessing array elements.
Input-output (printf, scan, etc.), string manipulations (strcpy, strcat, strlen, etc.)
Multi-dimensional arrays.
Pointers:
What pointers are, why there are used, and how they and memory addresses?
Pointer arithmetic.
Pointers and arrays.
Malloc, calloc, realloc for dynamic memory allocation and free to free the memory space allocated dynamically.
Structures and Unions:
Defining and using structures.
Accessing structure members.
Nested structures.
Introduction to unions.
File Handling:
Reading and writing files from C (structuring, opening, accessing and closing).
Position(s) of the file (open, read-only, write-only or append)
Different methods, which should be implemented for error handling while processing the files.
Preprocessor Directives:
Significantly, one of the areas that most students face great trouble in is tackling pre-processor directives (#define, #include, #ifdef, etc.)
Taking advantage of macros throughout the program’s code to reduce code redundancy and increase signal-to-clutter ratio, thus improving code readability and maintainability.
Advanced Topics:
Recursion.
Enumerations.
Typedef.
Bitwise operations.
Command line arguments.
Best Practices and Tips:
Coding conventions and standards.
Debugging techniques.
Memory management practices.
Performance optimization tips.
Projects and Exercises:
Giving out a few Specific tasks and activities that come under the topic in question so as to ensure that the knowledge imparted is put into practice.
So if you’re looking for a project that will allow you to use C programming, the following are some suggestions to consider.
CONCLUSION:
All of these topics can be developed into full-scale articles, with various examples and subtopics further elaborated with actual code snippets and describes. To encourage the reader, they can also include quizzes or coding challenges at the end of each section for the reader to solve before moving to the next section. However, using the samples for download and the exercises which are usually included in the lessons make the lessons more effective.
#C Programming Language#C Programming course#Online & Offline course#IT & Software Course#Software course
0 notes
Text
C Conditional Statements
Conditional statements are an integral part of programming, allowing us to control the flow of our code based on certain conditions. In the C programming language, these statements are essential for making decisions and creating flexible, interactive programs. In this article, we will delve into the world of C conditional statements, exploring the basics, nested if statements, and the if-else if ladder. By the end of this article, you’ll have a solid understanding of how to use these statements effectively to write more dynamic and responsive C programs.
#100daysofcode#programming#code#developers & startups#coding#developer#developers#coder#womenwhocode
0 notes
Text
C Programming में nested if else conditional statement का use कैसे करते हैं? - Nested IF Else Statement in C Programming in Hindi
http://dlvr.it/SsK2hb
0 notes
Text
C# if-else
In C# programming, the if statement is used to test the condition. There are various types of if statements in C#.
if statement
if-else statement
nested if statement
if-else-if ladder
0 notes
Text
Level Up Your C# Code: Harnessing the Dynamic Potential of if/else and switch Statements with Branching Logic
Introduction to conditional statements in C
Conditional statements are an essential part of any programming language, and C# is no exception. These statements allow us to control the flow of our code, making it more dynamic and responsive. In C#, two primary conditional statements are widely used: if/else and switch. In this article, we will explore the power of these statements and learn how to leverage their full potential to level up our C# code.
Understanding the if/else statement
The if/else statement is one of the fundamental building blocks of branching logic in C#. It allows us to execute different blocks of code based on a condition. The syntax is straightforward:
if (condition) { // Code to be executed if the condition is true
} else {
// Code to be executed if the condition is false
}
By using if/else statements, we can make our code more flexible and responsive. We can perform different actions depending on various conditions, allowing our program to adapt to different scenarios.
Advanced techniques with if/else statements
While the basic if/else statement is powerful on its own, there are advanced techniques that can further enhance its functionality. One such technique is using multiple if statements. Instead of just one condition, we can have multiple conditions, and each condition will be checked in order. If a condition is true, the corresponding block of code will be executed, and the rest of the if statements will be skipped.
Another technique is using nested if statements. This involves placing an if statement inside another if statement. This allows for more complex conditions and branching logic. By nesting if statements, we can create intricate decision trees that handle a wide range of scenarios.
Introduction to the Switch statement
Unlike an if/else statement, a switch statement provides a more concise and structured way to handle multiple conditions. It is especially useful when we have a single variable that can take on different values. The syntax of a switch statement is as follows:
switch (variable) {
case value1:
// Code to be executed if variable equals value1
break;
case value2:
// Code to be executed if variable equals value2
break;
default:
// Code to be executed if variable doesn't match any case break;
}
Using switch statements, we can handle multiple conditions in a more efficient way. It is often used when we have a single variable that can take on different values. We can write multiple case statements for the different values that the variable might take, and the corresponding code block will be executed if a match is found. If no match is found, the code inside the default block will be executed. Switch statements are especially useful when we need to handle many different conditions with large blocks of code. They provide a more organized and structured way to write our branching logic compared to if/else statements.
Read the rest on my WordPress Blog here: https://wp.me/p8uh8z-M3
John
0 notes
Text
Uhhhh, so I gotta admit defeat and admit I won’t be able to finish any of the projects I wanted to for NANA Week 2022 Day 7............ Sorry 😔😭
Instead I bring you a super sneak-peak of my long awaited (for me, anyway lmao) Nana Osaki mega meta analysis, in which I will be going through chapter by chapter discussing Nana Osaki as a character. This analysis will... very likely be very long and potentially my magnum opus contribution to the NANA community.
Today, I can only offer you the rough draft of my introduction and I can only hope anyone else wants to see more one day... lol
Nana Osaki, the deconstruction of the girl we wanted to be
By no means is my first experience reading and watching NANA a universal one. We’re in the midst of the NANA Renaissance at the time of writing this is in early 2022. Times are different now than they are then. Then being the year 2006. I was 14 or maybe even 13, just about to graduate from middle school into high school.
The thing to understand was I was raised in the era of “not like other girls.” Not like other girls were different from other girls, or at least they thought they were. Other girls were feminine, popular, and liked make up, fashion, dating boys and the color pink. They were sluts. And you were not, you were chaste and read books or were into some odd hobby that made you feel both ostracized from everyone else and better then them too. You were independent, that’s why you didn’t have any friends… it wasn’t because you couldn’t make any ok!! You weren’t like other girls, you were better.
Enter Nana Osaki.
She was cool and rebellious, she wasn’t like other girls. She was punk and edgy. Nana didn’t move to Tokyo for her boyfriend, she was independent. She didn’t need a man, even if she had one she let him go.
Nana was who we wanted to be, us young not-like-other-girls who first read NANA.
Fast forward many years. Ai Yazawa gets ill and puts NANA on hiatus. Attitudes change, not like other girls unlearn the internalized misogyny (or don’t… or do but change their sense of superiority to some other target). #MeToo, #YesAllWomen, #LoveWins, #BlackLivesMatter, #BringBackOurGirls, #IceBucketChallenge, #TakeAKnee, #FreeBritney [re-order later]. More people care about social justice but it’s been packaged and commodified in a capitalist hellscape. A virus, a pandemic, lockdown and quarantines… The world is forever different and NANA is still on hiatus.
But we can still reread NANA as many times over as we want in that span of time. And you read it enough times to realize… Nana Osaki the girl 13 year old you wanted to be? You were her, you were always her. You may not have dressed in vintage Vivienne Westwood, sing, or have a tattoo and piercings but you were her in all the ways that mattered.
Because just like you, Nana was just a scared little girl who wanted to be loved and was scared of rejection.
Unlike you time was frozen still for her, stuck between the pages of the manga. You grew up and she did not… And maybe… she never did even between the pages of the manga.
My ultimate thesis statement for this analysis is this: Nana Osaki character arc and journey through the series is not one of the usual character growth that we have come to expect in our narratives. Instead what we have witnessed in NANA is the deconstruction of one Nana Osaki. Like unraveling the wraps of a mummy, an unending nesting doll, or layers of an onion ala Shrek… Whatever metaphor you like best, Nana Osaki is deconstructed throughout the series* until what we find at the center of her character is the little girl her mom abandoned in the snow.
*this is not including the glimpses of Nana Osaki we see in the future. Without the key events that lead to that moment, it’s hard to really say for sure one way or the other.
And the Nana Osaki we met in the prologue as well as the Nana Osaki we left on that final page of chapter 84… She is fundamentally unchanged as a person, even if Nana’s life and loved ones expanded in all the chapters between. Every action, decision, and belief that Nana holds from prologue to chapter 84, Nana always had the capacity to do and hold.
Other aspects of Nana to be discussed include: her alcoholism, jealousy, possessiveness, and internalized conservative values within a punk sphere. [more to be added]
to be continued.................. Happy NANA Week, I cannot wait to bring you the rest one day.
34 notes
·
View notes
Video
tumblr
C# Advanced basics post-mortem
This time I decided if I want to make bigger projects, I needed to understand more specifically about the C# programming language I use and how it works so I can understand it to make the best fun games as possible.
I even made 3 short mini games as a little exercises to warm myself up.
What I learned
different types of variables like doubles, characters, and colour.
different ways of how variables/ parameters add with each other, e.g. float sum = (2 + 3) * (4 - (4 / 3)).
A better understanding of Enums and how the states can be used. e.g played dies or at main menu waiting for player to press play or restart, what happens next? does he move a inch or not?
The calculated difference of float and int when dividing them respectfully such as calculating the nearest inside numbers (part of floats).
Casting: Converts a variable to another variable. Eg int a = 5 into float a = 5.0f.
How more robust Lists can be, such as being counted, added, removed specifically or all selected, reversed, removed at range and etc. Also, an idea of what its generics are <>.
Different types of functions that can be used like voids, ints, floats and returning their parameters such as strings, ints and floats.
Functions store many parameters as much as they need. Also different types of functions can share the same name, except for the same types.
How effective and distinctive behaviour of If, if else and else statements of controlling mechanics.
Not to have so many if statements in a nested code otherwise it may affect performance of the game.
More detailed info, cleaner code, similarities to the ifs, if else, else statements and how complex switch Statements of how they execute with different variables to run code inside each of the cases and defaults.
the unique behaviour of breaks that break out of the code to execute outside code.
The Different types of loops such as For loops, for each loops, do while loops of how their used respectfully so it doesn't crash the computer on the wrong use.
Better understanding of Arrays of what the elements can contain such as ints, game objects, floats, bools, strings, doubles etc and how it can only be programmed to access their elements not outside its index or length.
How you can change array element values by code without setting its variables.
How for loop doesn't need to be specialised how many times to repeat the loop so it doesn't crash.
Advanced use of Coroutines such as Stopping Coroutines, waiting for seconds in real time (no matter how slow or fast the game is with time scale), how they can pass Parameters and strings to reference other functions and how the waitforseconds can be slowed or speed up by Time.TimeScale.
Passing arrays into void returning functions like ints. The parameters can even have the same names of its variables and it won't cause an error.
How interesting is to model objects from classes each with their variables and to update them overtime.
How useful are constructors when passing variables.
How "this." refers to the class variable and outside the function parameters.
Difference of Objects create that get passed in Memory as references and values.
More detail of Data encapsulation/visibility modifiers other than public or private. I learnt more such as Internal, protected modifiers, setting and getting variables.
A deeper understanding of inheritance such as from Mono behaviour and from other classes such as behaviours, functions, properties and variables.
How Inheritance works with child game classes using override functions to override the virtual function from their parent classes to do something else.
Most functions, datatypes values including transforms which are inherited from Mono behaviour.
The pros and cons of method overloading, while good to use a variety of functions and parameters, but needs to be specific of which function and parameters to run.
The use of the Ternary Operator such as using ? (if) and : (else) respectfully like if statements.
Variable Attributes and such as [RequireComponent], [ExecuteInEditMode], [AddComponentMenu], [HideInInspector], [Range]and [TextArea] which are broadly useful to read and get components to reduce unexpected issues, and makes the life's easier for designers, respectfully.
How static variables and functions can work together with each other's scripts without get components and creating objects. They also don't work with non-static variables and functions.
How Delegates can be used to subscribe or call events from scripts including statics
How to return value answers when adding or subtracting.
How to make log warnings and log errors execute by code in the console depending how the script is written.
-Pumpkins and Golems
The possibility that I can make a game based on its rigid body physics a little more than complex code. E.g dodging rolling pumpkins from a slope, etc
-Bombs Away
Being able to spawn bombs in-between min and max distances with floats randomly from one transform variable.
Being able to restrict players movement with floats, Vector 2 and if statements without using a box collider.
-Knife Hit
Able to add force on knife with either Space or Mouse keys respectfully without causing unwanted design issues or bugs.
Able to set the knife game object to be parent of the wood by collisions and turning off collisions with "Detect Collisions" by turning it false on the knife once collided.
Overall
It was a long and hard work to get a better understanding with these datatype concepts. But I'm glad that I've done it so I can get a better understanding of how C# works so that way once I start to make more complex games, I am more aware of how it works so its easier to understand, fix unexpected bugs, and work differant ways to execute code.
#Unity Engine#unity#casualgames#gamedevelopment#australiangamedevoloper#IndieGames#gaming#indiedev#Gamedev#soledevoloper#mini games#IndieGameDev#indiegaming
10 notes
·
View notes
Text
Price: [price_with_discount] (as of [price_update_date] - Details) [ad_1] Unit I lntroduction to Program Planning & C Programming Program Design Tools : Art of Programming through Algorithms, Flowcharts. Overview of C : History and importance C, Character Set, C Tokens, Keywords and Identifiers, Constants, Variables, Data types, Declaration of variables, Storage Class, Assigning Values to variables, Defining Symbolic Constants, Declaring a Variable as Constant, Declaring a Variable as Volatile. (Chapters - 1, 2, 3) Unit II Operators and Expressions Operators and Expressions : Arithmetic Operators, Relational Operators, Logical Operators, Assignment Operators, Increment and Decrement Operators, Conditional Operators, Bitwise Operators, Special Operators. Arithmetic Expressions, Evaluation of Expressions, Precedence of Arithmetic Operators, Operator Precedence and Associativity, Mathematical Functions. (Chapter - 4) Unit IIIControl Flow Decision Making and Branching : Simple If Statement, If-Else, Else-If, Switch Statement, Goto Statement Decision Making and Looping : While Statement, Do-While, For Statement, Break and Continue. (Chapter - 5) Unit IV Arrays Arrays : One Dimensional Arrays, Declaration of One-dimensional Arrays, Initialization of One dimensional Arrays, Two - dimensional Arrays, Initialization of Two - dimensional Arrays. Character Arrays and Strings : Declaration and Initialization String Variables, Reading Strings from Terminal, Writing Strings to screen, Putting Strings Together, Comparison of Two Strings, Introduction to String handling Functions. (Chapter - 6) Unit V User Defined Functions User Defined Functions : Need for User - defined Functions, A Multi - Function Program, Elements of User defined Functions, Definition of Functions, Return Values and their Types, Function Calls, Function Declaration, Category of Functions : No Arguments and no return Values, Arguments but No Return Values, Arguments With Return values, No Arguments but Returns a Value, Functions that Return Multiple Values, Nesting of Fu Publisher : TECHNICAL PUBLICATIONS, PUNE (2 August 2024); TECHNICAL PUBLICATIONS, PUNE. HARSHWARDHAN : 9763719464 Paperback : 260 pages ISBN-10 : 935585689X ISBN-13 : 978-9355856890 Reading age : 18 years and up Country of Origin : India Packer : TECHNICAL PUBLICATIONS, NARHE, PUNE [ad_2]
0 notes
Text
When one reached a certain age, the concept of being old became timeless.
Biology foretold that being old meant sagging skin, the pinch of one's nose, the many aches all over. And these signs mean time passed — that flesh liked to be wimpy when it wanted to be, that years of living could do that.
Gravity placed wrinkles on weathered hands, and time said that the slow, slow realization was a blessing that came with it.
At first, Marcy didn't agree with that last statement.
After all, the words sounded too fake, too philosophical. Perception could happen in an instant, after all. Marcy had realized that her baby teeth weren't baby teeth any more, that the window sill of her room got painted green all over when the wood rotted, and puberty came and went — with the pimples, the changes down under, the squeaks in her voice.
She noticed these changes were prominent and weird and who wouldn't remark about the body? After all, white hair came down to hair negligence, genetics, stress, and age. Same for many other traits.
Why would one have a slow realization of being old? It made no sense.
Until it did.
Because being old never touched the mind nor the body in the way that a fifteen-year-old predicted.
An example: Marcy remembered waking up numerous times.
She'd be twenty-one when she woke up, and the first thought wasn't of mortgage but about the latest DM sesh down at the comic shop.
She'd be twenty-four when she woke up, the first thought wasn't of hospital bills but what her colleagues would think over her newest innovation — an algorithm, computing the latest statistics from the traveling agencies.
Then she'd be twenty-seven when she woke up warm, Anne's head nestled against her chest. Marcy's arms got sweaty. They got sweaty from body heat, over the cushions bedding their form, listening intently to the So-Cal radio a few feet away.
Thirties. Her smiles remained consistent. She had another DM session, got labelled the Queen of C&C by the youngest intern, and she laughed in delight when the rest agreed. Her apartment became a home. She liked to scratch her cat's ears, tell her Labrador that if he ate her chili dog he would die — even if his name was Sonic the Hedgehog. She kept schedules, took medication, asked for a psychiatrist, and got herself out of jury duty.
Then the forties. She wrote the number down in numerous journals, always pondering the concept of what it meant to be forty, or forty-three, or forty-seven. Marcy didn't get much of an answer. But she did get kisses on her cheek, a few whispers and giggles because gosh flirting never got old, and she heard a new show came on air. She heard that the writing was great, the scheduling not so much. Was that all forties? Did forties allow for that?
Because she would dance with her love under some tree in a random park out in the countryside. They drew frogs and placed the sticky notes on lampposts. She grabbed pine cones for her new hiking collection. Montana would then flit past the van's windows, the girls laughing over how Anne almost threw up over a bear and how Sasha fought said bear with her ready hands with no shits given. Then Marcy got phone calls that left her sobbing on the hotel floor, buying plane tickets to say the last questionable goodbyes to a dying father she spilled her guts over in counseling.
Her house got a paint job.
Adoption got considered under the strained light of a lamp.
Mortgage, politics, ulcers, bills.
New shows to binge, new shows to analyze on some blogs on some websites.
Roll for a perception check.
New funerals. New celebrations.
Manifested arguments and apologies under the same roof, the same roof where she and Anne kissed as if no one was there to see.
Yunan and Olivia visited. Mom talked about her will, about the newest houses out in the country. Anne rubbed her shoulders once and asked if she needed a vacation and Marcy couldn't help but say yes.
Marcy asked Sasha's fifteen-year-old if he liked the dab. And that same kid looked at her as if she said nothing but gibberish. So she laughed with Sasha over how old they were and Sasha scoffed the idea, said that everything else seemed the same.
The same, yet different.
And Marcy couldn’t help but agree.
Life became this. The constant ups and downs, the people to impress and deny, the continued mistakes and learning that made Marcy all the more wiser and perplexed and dumb.
After all, it seemed like last year that she kissed Anne up in some stuffy dorm — when really it was fifty years ago.
Meeting her bestest friends in the world? Ten years more.
With this in mind, she still couldn't differentiate between the right ways to converse and why the talk of the weather bored her. Or why Anne hated the word 'moist' when it got applied to bakery goods.
Biology foretold that her joints would ache, that Marcy had to jog harder in the early Amphibia mornings when Joe's descendants fluttered past her. She knew that sleep got less, that jobs took her mind, made her less agile with the days and days passing.
Yet her smiles deepened, her kisses sweeter than before. She collected swords, grew proud over the C&C players and their new found family, and enjoyed annoying Sasha's kids with outdated slang until their eyes rolled out of their sockets.
She knew now what old meant.
And as Marcy Wu stared at her leather hands — at her dimpled cheeks, at the chocolate eyes hidden among a nest of wrinkles — there came no fear at what she found.
Just the simple joy of being alive.
141 notes
·
View notes
Note
I don’t really belong to a denomination so I haven’t really ever gotten kicked out of a church or youth group before.
I was asked to leave a pro life group though. In was in person, way before covid. Very small group. We didn’t really have a prescience online. It felt more like a Bible group meeting up at someone’s house without the bible. I argued that women who either choose or were forced to go through a c section birth are still mothers after a young girl who isn’t a mother and never was one argued that they weren’t because childbirth pain makes you one. She went pretty far. Adopting your kids doesn’t make you one. Fostering kids doesn’t make you one. She said how women even dying in childbirth should die because it’s an honorable death. I sort of snapped since I lost a few members to childbirth complications in the past. I cussed her out so the group did ask me to leave. I was happy though that literally every one else called that girl out for being stupid and cruel. Even her own sister called her a dumbass out loud. And then she had to start crying and play victim. Last I heard, the group fell apart. I guess I triggered her because that young girl kept being bothered by me even after I left. I was actually asked to return but I wasn’t interested. That girl is young, I’ll pray for her, because throughout the time I’ve seen her, she just seemed lost and easily sucked into things she sees online. She was into crypto for a bit. Then e girl aesthetics. Then cottagecore. Then 1 week she tried to convert to Islam. A few weeks later, it was crystals and reiki and tarot cards. A while ago I remember she was like rad fem? I guess when I was there at the end, she was listening to male centric content that’s violent towards women. It explained the cruelty in what she said. But i believe also that she just tried to repeat what she read and heard from others online to me thinking I’ll somehow be convinced that she’s right. I’m not super close with her sister but I do follow her on instagram. Her sisters latest thing is anti capitalist liberal bimbo core. Bless her heart… she needs prayers, good lord.
Man, this girl is so stupid it's almost comical🫠
You should've asked her that since most women go through delivery with epidural anesthesia lowering the pain of childbirth, does it mean they didn't 'totally' give birth? 🤔
I heard so many drama about pro life group. It's like a nest intellectually sheltered young girls who will spout the most bizarre statements about basic biological facts. Yeah, she mingling with scrotes might explains her asinine takes. She should've asked them since men don't have pain during childbirth, does it mean none of them are father? 🤔
I always said that women shouldn't seek after men opinion when it came to issues exclusive to women. Especially biological sex. In another ask I was talking about a girl who was formerly a radical feminist who was now more like tradfem/conservative and she was doing a podcast with a meninist and who was like spouting the most basic gotcha about feminism à la "female solidarity doesn't exist, and when they do it only revolves around their biology" GEEZZZ I WONDER WHY JEAN-FRANÇOIS 🙃 This exchange was so low quality and underwhelming...it wouldn't be so annoying if both of them didn't act like they were really doing something but no actually this discourse already happened in 2013 during the SJW+libfem vs meninism fight uuuuugh French contrarian YouTubers are always so stupidly late to the party.....🫠 like that girl is pretty lost and I hope she'll grasp that leaving feminist and becoming trad doesn't mean eating up the koolaid of basic men "trad" who -while they don't have to agree with feminism- will never have to self awareness to grasp the dimension of femalehood beside a male centric perspective.
Anyway your friend might be like this girl, she's lost and eventually she'll come around. Especially if she's young. I'm glad I've never bothered to slap onto myself whatever trendy label (feminist, tradfem, conservative, contrarian, etc) bc I feel like it messes people up whenever they get challenged in theif fundamental belief system.
2 notes
·
View notes